import axios from 'axios'
import { message } from 'antd'

const request = axios.create({
	timeoutErrorMessage: '链接超时..',
	timeout: 10000
})


request.interceptors.request.use((config) => {
	message.loading({ content: '数据加载中...', key: 1 })
	return config
}, (error) => {
	return Promise.reject(error)
})


request.interceptors.response.use((response) => {
	message.success({ content: '数据加载成功!', key: 1 })
	return response
}, (error) => {
	return Promise.reject(error)
})

export default request